//=========== Float Div ==============//
var floatSelector = '.rightleftads', floatMargin, curWindowHeight, lastScrollTop;
//--Max Top
var floatParent, floatParentPos, floatParentHeight, maxScrollTop;
//--Start Position
var FloatPosition, floatWidth;

jQuery(document).ready(function () {
    floatSelector = '.rightleftads';
    jQuery(window).resize(function () {
        if (1210 >= $(window).width()) {
            $('.rightleftads').hide();
        }
        else {
            $('.rightleftads').show();
        }
    });
    jQuery(window).scroll(function () {
        try {
            var curFloatPosition = jQuery('' + floatSelector).position();
            var curFloatHeight = jQuery('' + floatSelector).height();
            var docScrollTop = jQuery(document).scrollTop();
            var scrollBottom = jQuery(document).height() - $(window).height() - jQuery(document).scrollTop();

            //alert(curFloatHeight + '-' + docScrollTop + '-' + scrollBottom);

            if (docScrollTop > 710) {
                jQuery('' + floatSelector).css('top', '3px');
                jQuery('' + floatSelector).css('position', 'fixed');
            }
            else {
                jQuery('' + floatSelector).css('top', '710px');
                jQuery('' + floatSelector).css('position', 'absolute');
            }

        } catch (err) {

        }
    });
});